import static org.junit.Assert.*;

import java.io.File;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;

import omero.ApiUsageException;
import omero.ServerError;
import omero.client;
import omero.api.ServiceFactoryPrx;
import omero.api.delete.DeleteCommand;
import omero.api.delete.DeleteHandlePrx;
import omero.api.delete.DeleteReport;
import omero.grid.DeleteCallbackI;
import omero.model.Image;
import omero.model.ImageI;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import cli.OmeroServer;
import cli.FileOperations;

import pojos.ImageData;



public class Logging {
	
	private static client unsecureClient = null;
	private static ServiceFactoryPrx session = null;
	private static ImageData imageNew;
	
	private static String hostName = "192.168.20.108";
	private static String username = "root";
	private static String password = "omero";
	private static int port  = 10000;
	
	
	@BeforeClass
	public static  void oneTimeSetUp() throws Exception {
		OmeroServer.open(hostName, port, username, password);
	}

	@AfterClass
	public static void oneTimeTearDown() throws Exception {
		OmeroServer.close();
	}
	
	@Before
	public void setUp() {
		
	}
	
	@After 
	public void tearDown() {
	}
	
	@Test
	public void testAddRatingAnnotation() {

		try {
			String filename = "./data/40X.tif";
			File file = new File( filename );
			String sh1 = FileOperations.generateSha1( filename );
			OmeroServer.addFileToImage(filename, sh1, imageNew, null );
			
		} catch (ServerError e) {
			
			e.printStackTrace();
		} catch (IOException e) {
		
			e.printStackTrace();
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}

}
